// XUser_Logic.h: interface for the XUser_Logic class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_XUSER_LOGIC_H__DD5A6D93_5897_4BE8_80F6_02201CFD9EB0__INCLUDED_)
#define AFX_XUSER_LOGIC_H__DD5A6D93_5897_4BE8_80F6_02201CFD9EB0__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "winsock2.h"
#include "XEIM_User.h"
#include <map>
#pragma warning(disable:4786)

using namespace std;

class XUser_Logic
{
	map<SOCKET, XEIM_User*> m_users;
public:
	CString GetUserIP(SOCKET sock);
	BOOL SocketExist(SOCKET sock);
	void AddUser(SOCKET sock, XEIM_User* pUser);
	void RemoveUser(SOCKET sock);
	int GetSize();
	XEIM_User *GetUser(SOCKET sock);
	SOCKET GetSocket(const char *szUser);
	XUser_Logic();
	virtual ~XUser_Logic();

};

#endif // !defined(AFX_XUSER_LOGIC_H__DD5A6D93_5897_4BE8_80F6_02201CFD9EB0__INCLUDED_)
